package com.luozhengdong;

public class Qipan {
	 Point [][] points;

	Point[][] getPoints() {
		return points;
	}
	void setPoints(Point[][] points) {
		this.points = points;
	}
	
	
	/**
	 * 棋盘
	 */
	public Qipan() {
		points=new Point[20][20];
		//每次下棋绘制点
		for(int y=0;y<points.length;y++) {
			Point[] row=points[y];
			for(int x=0;x<row.length;x++) {
				Point p=new Point();
				p.x=x;
				p.y=y;
				p.color=0;
				row[x]=p;
			}			
		}
	}
	/**
	 * 绘制棋盘
	 */
	void draw() {
		System.out.println();
		System.out.println();
		System.out.println();
		for(int y=0;y<15;y++) {
			Point[] row=points[y];
			for(int x=0;x<15;x++) {
				Point p=row[x];
				p.paint();
			}
			System.out.println();
		}
	}
	/**
	 * 判断棋盘是否满了
	 * @return
	 */
	boolean isFull() {
		for(int y=0;y<15;y++) {
			Point[] row=points[y];
			for(int x=0;x<15;x++) {
				Point p=row[x];
				//如果还有放置点可用
				if(p.color==0) {
					return false;
				}
			}
		}
		return true;
	}
}
